package main

import "fmt"

type Phone struct {
	Name  string
	Price int
}

type Compoter struct {
}

type Usb interface {
	start()
	stop()
}

func (c Compoter) work(u Usb) {
	u.start()
	u.stop()
}

func (p Phone) start() {
	fmt.Printf("%v 开始了\n", p.Name)
}

func (p Phone) stop() {
	fmt.Printf("%v 结束了\n", p.Name)
}

func main() {
	// var p = Phone{}
	// p.Name = "iphone4"
	// p.start()

	p := Phone{
		Name: "iphone11",
	}

	var u1 Usb

	u1 = p

	c := Compoter{}
	c.work(u1)
}
